﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuickGame.Model
{
    public class LuotChoiHs
    {
        public static IQueryable<LuotChoi> QueryEntities(ModelContext modelContext)
        {
            return modelContext.LuotChois;
        }

        public static LuotChoi QueryEntity(ModelContext modelContext, long id)
        {
            return modelContext.LuotChois.Single(k => k.ID == id);
        }

        public static LuotChoi Insert(ModelContext modelContext)
        {
            LuotChoi lc = new LuotChoi();
            modelContext.LuotChois.AddObject(lc);
            return lc;
        }
        public static void Delete(ModelContext modelContext, long id)
        {
            LuotChoi nd = modelContext.LuotChois.Single(k => k.ID == id);
            modelContext.LuotChois.DeleteObject(nd);
        }
        //public static void Update(ModelContext modelContext, LuotChoiView view)
        //{
        //    LuotChoi nd = modelContext.LuotChois.Single(k => k.ID == view.ID);
        //    nd.ID = view.ID;
        //    nd.Ma = view.Ma;
        //    nd.Ten = view.HoTen;
        //    nd.NgaySinh = view.NgaySinh;
        //    nd.GioiTinh = view.GioiTinh;
        //    nd.Email = view.Email;
        //    modelContext.SaveChanges();
        //}
    }
}